from django.db import models

# Create your models here.
import settings

class Plan(models.Model):
    
    plan_name = models.CharField(verbose_name="计划名称", max_length=100)
    plan_type=models.IntegerField(verbose_name="计划类型",choices=[(1,'单次计划'),(2,'日计划'),(3,'周计划'),(4,'月计划')])
    PLAN_LEVEL_LIST = [(1, '一星计划'), (2, '二星计划'), (3, '三星计划'), (4, '四星计划')]
    plan_user= models.ForeignKey(settings.AUTH_USER_MODEL, models.CASCADE, related_name="plan_user",
                                    verbose_name="执行人")
    plan_grade = models.IntegerField(verbose_name="计划星级",
                                      choices=PLAN_LEVEL_LIST)
    plan_details = models.TextField(verbose_name="计划详情")
    plan_start = models.DateTimeField(verbose_name="开始时间")
    plan_end = models.DateTimeField(verbose_name="结束时间")
    
    def __str__(self):
        return self.plan_name


